package com.zzl.alligator.management.monitor.service.impl;


import com.zzl.alligator.management.monitor.mapper.SysJobLogMapper;
import com.zzl.alligator.management.monitor.domain.SysJobLog;
import com.zzl.alligator.management.monitor.service.ISysJobLogService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * 定时任务调度日志表(SysJobLog)服务层
 *
 * @author zhouziliang
 * @since 2020-07-11
 */
@Service
public class SysJobLogService implements ISysJobLogService {
    
    @Autowired
    private SysJobLogMapper sysJobLogMapper;
    
    /**
     * 通过ID查询单条数据
     *
     * @param jobLogId 主键
     * @return 实例对象
     */
    @Override
    public SysJobLog findSysJobLogById(Long jobLogId) {
        return sysJobLogMapper.findSysJobLogById(jobLogId);
    }

   /**
     * 通过实体作为筛选条件查询
     *
     * @param sysJobLog 实例对象
     * @return 对象列表
     */
    @Override
    public List<SysJobLog> findSysJobLogList(SysJobLog sysJobLog) {
        return sysJobLogMapper.findSysJobLogList(sysJobLog);
    }

    /**
     * 新增数据
     *
     * @param sysJobLog 实例对象
     * @return 实例对象
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSysJobLog(SysJobLog sysJobLog) {
        return sysJobLogMapper.insertSysJobLog(sysJobLog);
    }

    /**
     * 修改数据
     *
     * @param sysJobLog 实例对象
     * @return 实例对象
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateSysJobLog(SysJobLog sysJobLog) {
        return sysJobLogMapper.updateSysJobLog(sysJobLog);
    }

    /**
     * 通过主键删除数据
     *
     * @param jobLogId 主键
     * @return 是否成功
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteById(Long jobLogId) {
        return sysJobLogMapper.deleteById(jobLogId);
    } 
    
}